Repository navigation
Readability refactoring in FakeFileOpen and Patcher - #1378
Merged
mrbean-bremen merged 4 commits intoNov 22, 2026
Merged
mrbean-bremen merged 4 commits into
mrbean-bremen merged 4 commits into
Conversation
Move the branch that wraps an already open fake pipe descriptor unchanged into _open_pipe_wrapper(), shortening call().
Move the nested read/write permission condition into the new _is_access_denied() helper so the caller reads as a single check.
Name the nine-part condition in Patcher.__init__ as has_custom_arguments so its intent is clear at the call site.
Use snake_case like the surrounding Patcher attributes (PEP 8).
mrbean-bremen
approved these changes
Nov 22, 2026
mrbean-bremen
left a comment
Member
There was a problem hiding this comment.
That's ok! It doesn't change any functionality and does indeed increase readability a bit. I use to do this kind of refactoring myself, usually in the context of some other change.
Do you wanted to add more changes?
Contributor
Author
Thank you for the quick review! No further changes are planned for this PR, so it's ready to merge as is. I’m planning to submit couple more separate PRs for code refactoring. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes a few small refactoring changes to improve readability and maintainability without changing the existing behaviour.
Changes:
These changes make some of the longer methods and complex conditions easier to understand and maintain. I ran the existing tests locally on Windows, and they passed without any modifications. Pre-commit checks also pass.
This PR is part of a university refactoring assignment. I am happy to make adjustments or remove any changes based on your feedback.